package com.twu.biblioteca;

import com.twu.model.Customer;
import com.twu.model.Library;

/**
 * Created with IntelliJ IDEA.
 * User: FSW
 * Date: 01/06/13
 * Time: 下午 10:03
 * To change this template use File | Settings | File Templates.
 */
public class Login {
    public static Customer login(Library library, String username, String password){
        for(Customer customer: library.getCustomers()){
            //check username && password
             if(customer.getName().equals(username) && customer.getPassword().equals(password)){
                 return customer;
             }
        }
        return null;
    }
}
